<template>
    <a-form layout="inline">
      <a-form-item v-for="(item,index) in inputs" :key="index" :label="item.lable">
      <slot :name="item.name"/>
    </a-form-item>
    <a-form-item>
      <a-button icon="search" type="primary" @click="submit">搜索</a-button>
    </a-form-item>
    </a-form>
</template>

<script>
export default {
  props:['model'],
  data() {
    return {
      inputs:[]
    };
  },
  created(){
      const slotObj = this.$slots
      for(let slotKey in slotObj){
         this.inputs.push({name:slotKey,lable:slotObj[slotKey][0].data.attrs.lable})
      }
      
  },
  methods: {
      submit() {
        this.$emit("search");
      }
  }
};
</script>

<style>
</style>